package com.example.mapper;

import com.example.dto.VisitRecordWithStuDto;
import com.example.dto.VisitRecordWithStuPageDto;
import com.example.entity.VisitUser;
import com.example.vo.VisitVo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface VisitUserMapper {
    Page<VisitVo> getBySnoWithDno(VisitRecordWithStuPageDto vpDto);

    @Insert("insert into visitrecord (sno, dno, in_time, out_time) " +
            "VALUE" +
            "(#{sno},#{dno},#{inTime},#{outTime})")
    void add(VisitUser visitUser);
    @Delete("delete from visitrecord where sno = #{sno} and dno = #{dno}")
    void deleteBySnoWithDno(@Param("dno") String dno, @Param("sno") String sno);

    void update(VisitUser visitUser);

    void update2(VisitRecordWithStuDto visDto);
    @Insert("insert into visitrecord (sno, dno, in_time, out_time) " +
            "values " +
            "(#{sno},#{dno},#{inTime},#{outTime})")
    void add2(VisitRecordWithStuDto visDto);
}
